﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Silvana01_UI_Form
{
    public partial class FrmHotelUpdate : Form
    {
        public FrmHotelUpdate()
        {
            InitializeComponent();
        }

        RefMaeHoteles.WS_MaeHoteles ws_hoteles = new RefMaeHoteles.WS_MaeHoteles();

        private void textBox5_TextChanged(object sender, EventArgs e)
        {

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void FrmHotelUpdate_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {

                if (ws_hoteles.ActualizarHoteles(txtCodigo.Text, txtDesc.Text, txtDir.Text, txtLocalCod.Text, txtLocalDes.Text, txtMail.Text, txtFono.Text, txtRepLegal.Text))
                {
                    MessageBox.Show("Hotel Actualizado con Exito");
                    txtCodigo.Clear();
                    txtDesc.Clear();
                    txtDir.Clear();
                    txtLocalCod.Clear();
                    txtLocalDes.Clear();
                    txtMail.Clear();
                    txtFono.Clear();
                    txtRepLegal.Clear();
                }
                else
                {
                    MessageBox.Show("Error en actualizacion");
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Se ha producido un error:" + ex.Message);
            }

        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
